package org.chen.common.ctrip.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;

@Data
@TableName(value = "ctrip_product", autoResultMap = true)
public class Product {
    @TableId(type = IdType.INPUT)
    private String id;
    
    private String title; // mainName
    private String content; // name
    private String city;
    private String locationsCity;
    private Integer durationDays;
    private String pageContent;
    private String pageDiv;
    private String productType;
    private Integer level;
    private Integer minDays;
    private Integer maxDays;
    private String imageUrl;
    private Boolean isAi = false;

    private String firstDay;
    private String lastDay;
    private Boolean askAi; // AI是否总结过

    // tags字段，使用JSON格式存储标签列表
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> tags;

    private Double price;
    private Double originalPrice;
    private String departures; // JSON格式存储
    private String locations; // JSON格式存储
    private Boolean detailFetched; // 是否获取过详情
    private String staticPagePath; // 静态页面网络路径
    private String localPagePath; // 静态页面绝对路径
    private LocalDateTime createTime;
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private String language = "zh"; // 默认语言
}